<!-- Content Header (Page header) -->
<section class="content-header">
  <h1>
    管理员管理
    <!--<small>Optional description</small>-->
  </h1>
  <ol class="breadcrumb">
    <li><a href="#">首页</a></li>
    <li class="active">用户管理</li>
    <li>管理员管理</li>
  </ol>
</section>

<!-- Main content -->
<section class="content">
  <div class="row">
    <div class="col-xs-12">
      <div class="box">
        <div class="box-header">
          <h3 class="box-title">管理员列表</h3>
          <div class="box-tools" style="padding-top: 3px">
            <a class="btn btn-block btn-default" style="display: inline" href="<%= new_admin_user_path %>">
              <i class="fa fa-fw fa-plus"></i> 添加
            </a>
          </div>
        </div><!-- /.box-header -->
        <div class="box-body table-responsive no-padding">
          <table class="table table-hover">
            <tr>
              <th>ID</th>
              <th>用户名</th>
              <th>创建时间</th>
              <th>操作</th>
            </tr>
            <% @users.each do |user| %>
                <tr>
                  <td><%= user.id %></td>
                  <td><%= user.name %></td>
                  <td><%= user.created_at.localtime.to_s(:db) %></td>
                  <td>
                    <a class="btn-sm btn-default" href="<%= edit_admin_user_path(user) %>">
                      编辑
                    </a>
                    &nbsp;&nbsp;
                    <%= link_to '删除',admin_user_path(user),method: :delete, data: { confirm: '你确定要删除吗?'}, class: 'btn-sm btn-default' %>
                  </td>
                </tr>
            <% end %>
          </table>
        </div><!-- /.box-body -->
      </div><!-- /.box -->
    </div>
  </div>
</section><!-- /.content -->

